<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('box_turnover', function (Blueprint $table) {
            $table->id()->comment('自增id');
$table->bigInteger('order_id')->comment('单据id');
$table->tinyInteger('doc_type')->comment('单据类型');
$table->string('material_no', 120)->comment('物料编码');
$table->string('from_lotnum', 120)->comment('原始箱号/批号');
$table->string('lot_num', 120)->comment('箱号/批号');
$table->decimal('qty')->default(0)->comment('数量');
$table->string('location', 120)->nullable()->comment('库位');
$table->creatorId();
$table->createdAt();
$table->updatedAt();
$table->deletedAt();

$table->engine='InnoDB';
$table->comment('箱号周转记录');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('box_turnover');
    }
};
